<include file="Common:layout" />
<body style="background-color: #FFF; overflow: auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>模板添加</h3>
                <h5>添加短信服务模板</h5>
            </div>
        </div>
    </div>
    <!-- 操作说明 -->
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span>
        </div>
        <ul>
            <li>请根据短信服务平台，添加服务平台存在的模板，并与服务平台模板保持一致，还需确保模板唯一性。</li>
        </ul>
    </div>

    <form method="post" id="handlepost" action="{:U('System/add_sms_template')}" name="form1">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label>服务平台</label>
                </dt>
                <dd class="opt">
                    <select name="sms_id" id="sms_id">
                        <option value="">请选择服务平台</option>
                        <foreach name="sms_service" item="sv">
                            <option value="{$sv.sms_id}">{$sv.sms_name}</option>
                        </foreach>
                    </select>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>使用场景</label>
                </dt>
                <dd class="opt">
                    <select name="send_scene" id="send_scene">
                        <option value="">请选使用场景</option>
                        <foreach name="tpl_scene" item="scene" key="k">
                            <option value="{$k}">{$scene}</option>
                        </foreach>
                    </select>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>模板名称</label>
                </dt>
                <dd class="opt">
                    <input name="sms_title" type="text" class="w150"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>模板ID</label>
                </dt>
                <dd class="opt">
                    <input name="sms_tpl_code" type="text"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>签名</label>
                </dt>
                <dd class="opt">
                    <input name="sms_sign" type="text" class="w200"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>模板内容</label>
                </dt>
                <dd class="opt">
                    <input name="tpl_content" type="text" class="w400"/>
                </dd>
            </dl>
            <div class="bot">
                <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" id="subBtn">保存</a>
            </div>
        </div>
    </form>
</div>
<div id="goTop"> <a href="JavaScript:void(0);" id="btntop"><i class="fa fa-angle-up"></i></a><a href="JavaScript:void(0);" id="btnbottom"><i class="fa fa-angle-down"></i></a></div>
<script type="text/javascript">
    $(function(){
        $("#subBtn").click(function(){
            var send_scene = $("#send_scene").val();
            var sms_id = $("#sms_id").val();
            if(!sms_id || !send_scene){
                layer.alert("请完善模板信息");return false;
            }
            $("#handlepost").submit();
        });
    });
</script>
</body>
</html>